10 HOME
20 PRINT CHR$(4);"PR#3"
21 DIM B(20,80)
23 DIM D(20,80)
24 X1=10:Y1=42:BB=0:B=0

30 ONERR GOTO 31


31 INVERSE:VTAB 1:HTAB 30:PRINT"MAZE PAINTER TOOL":VTAB 23:HTAB 1:PRINT"                                                                               ":VTAB 23:HTAB 26:PRINT"PRESS ANY KEY TO BE CONTINUE"
32 VTAB 23:HTAB 55:GET Z$:VTAB 23:HTAB 55:PRINT Z$:NORMAL


33 ONERR GOTO 34

34 HOME:INVERSE:VTAB 23:HTAB 1:PRINT" PLEASE INSERT A DATA DISK IN SLOT 6 DRIVE 2,THEN PRESS <SPC> TO BE CONTINUE. ":VTAB 23:HTAB 79:GET G$:VTAB 23:HTAB 79:PRINT G$:NORMAL

35 IF G$<>" " THEN 34

36 NORMAL:D2=1:GOSUB 15800


39 NORMAL:HOME:ONERR GOTO 22200



40 VTAB 10:HTAB 40:PRINT " "
45 VTAB 10:HTAB 40:PRINT "M"
50 INVERSE:VTAB 10:HTAB 42:PRINT "$":NORMAL
52 VTAB 20:HTAB 6:PRINT"Y":VTAB 20:HTAB 10:PRINT"I":VTAB 20:HTAB 15:PRINT"       ":VTAB 20:HTAB 32:PRINT"S - SAVE MAZE":VTAB 20:HTAB 66:PRINT"DOLLAR :    0"
54 VTAB 21 :HTAB 5:PRINT"G H":VTAB 21:HTAB 9:PRINT"J K":VTAB 21:HTAB 15:PRINT"F - PAINTER":VTAB 21:HTAB 32:PRINT"L - LOAD MAZE":VTAB 21:HTAB 47:PRINT"X - CATALOG":VTAB 21:HTAB 66:PRINT"  STEP :    0"
56 VTAB 22 :HTAB 6:PRINT"B":VTAB 22:HTAB 10:PRINT"M":VTAB 22:HTAB 15:PRINT"Q - QUIT":VTAB 22:HTAB 32:PRINT"C - CLEAR SCN":VTAB 22:HTAB 66:PRINT"RESTEP :    0"

58 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                               ":NORMAL
59 GOSUB 1200

60 R1=0:NO=0
62 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 11:GET A$:GOSUB 55000:VTAB 23:HTAB 11:PRINT A$:NORMAL
65 IF A$="Q" THEN 7000

74 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 50000
75 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 50000
76 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 50000
77 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 50000

78 IF A$="I" THEN X2=X1-1:Y2=Y1:GOSUB 50100
80 IF A$="J" THEN X2=X1:Y2=Y1-1:GOSUB 50100
90 IF A$="K" THEN X2=X1:Y2=Y1+1:GOSUB 50100
95 IF A$="M" THEN X2=X1+1:Y2=Y1:GOSUB 50100

100 IF A$="Y" THEN X2=X1-1:Y2=Y1:GOSUB 50200
110 IF A$="G" THEN X2=X1:Y2=Y1-1:GOSUB 50200
120 IF A$="H" THEN X2=X1:Y2=Y1+1:GOSUB 50200
130 IF A$="B" THEN X2=X1+1:Y2=Y1:GOSUB 50200

162 IF A$="F" THEN 30000


172 IF A$="S" THEN 15000
180 IF A$="L" THEN 15100
182 IF A$="C" THEN 15500
184 IF A$="X" THEN 15800

200 GOTO 60

 

650 INVERSE:VTAB 23:HTAB 1:PRINT"              WAITING                       ":NORMAL

660 FOR I=0 TO 20
670 FOR J=0 TO 80
680 IF B(I,J)<>1 THEN B(I,J)=0
690 NEXT J
700 NEXT I
705 INVERSE:VTAB 23:HTAB 15:PRINT"        ":NORMAL
710 GOTO 60
 

900 IF H2>9 THEN N2=N2-1
910 IF H2>99 THEN N2=N2-1
920 IF H2>999 THEN N2=N2-1
930 VTAB N1:HTAB N2: PRINT H2
940 RETURN




1000 IF X2<1 THEN X2=19
1010 IF X2>19 THEN X2=1
1020 IF Y2<1 THEN Y2=79
1030 IF Y2>79 THEN Y2=1
1040 RETURN

1100 IF B(X1,Y1)=0 THEN BB=BB+1
1110 RETURN 

1150 IF B(X1,Y1)=1 THEN BB=BB-1
1160 RETURN

1200 IF BB<0 THEN BB=0
1210 IF BB<10 AND BB>-1 THEN NN1=78
1220 IF BB<100 AND BB>9 THEN NN1=77
1230 IF BB<1000 AND BB>99 THEN NN1=76
1240 IF BB<10000 AND BB>999 THEN NN1=75
1242 VTAB 20:HTAB 75:PRINT"    "
1260 VTAB 20:HTAB NN1:PRINT BB
1270 RETURN

1400 N1=21:N2=78
1410 IF S1>9 THEN N2=N2-1
1420 IF S1>99 THEN N2=N2-1
1430 IF S1>999 THEN N2=N2-1
1440 VTAB N1:HTAB N2: PRINT S1
1450 RETURN


1500 IF X2<1 THEN X2=19
1510 IF X2>19 THEN X2=1
1520 IF Y2<1 THEN Y2=79
1530 IF Y2>79 THEN Y2=1
1540 RETURN


1600 IF X2<7+P1 THEN X2=13+P2
1610 IF X2>13+P2 THEN X2=7+P1
1620 IF Y2<37+P3 THEN Y2=43+P4
1630 IF Y2>43+P4 THEN Y2=37+P3
1640 RETURN


1700 IF XD<7+P1 THEN XD=13+P2
1710 IF XD>13+P2 THEN XD=7+P1
1720 IF YD<37+P3 THEN YD=43+P4
1730 IF YD>43+P4 THEN YD=37+P3
1740 RETURN



7000 HOME:PRINT CHR$(4);"CATALOG"+",D1,S6":END


9000 FOR I=1 TO 19
9010 FOR J=1 TO 79
9020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 9040
9030 VTAB I:HTAB J:PRINT" "
9040 NEXT J
9050 NEXT I

9060 RETURN
  

15000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15005 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
15007 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

15009 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 15000



15012 PRINT CHR$(4);"OPEN";F$
15020 PRINT CHR$(4);"WRITE";F$ 
15030 FOR I=1 TO 19
15040 FOR J=1 TO 79
15050 PRINT B(I,J)
15060 NEXT J
15070 NEXT I
15072 PRINT CHR$(4);"CLOSE";F$

15074 X9=10:Y9=40:V8=10:V9=38:G1=0:MA=0

15075 M(1)=1:M(2)=2:M(3)=3:M(4)=4:M(5)=5:M(6)=6:M(7)=7:M(8)=8

15076 T$="R  DR  D  DL  L  UL  U  UR "


15081 PRINT CHR$(4);"OPEN";F$+".INDEX"
15082 PRINT CHR$(4);"WRITE";F$+".INDEX"
15083 PRINT X1:PRINT Y1:PRINT X9:PRINT Y9:PRINT V8:PRINT V9:PRINT G1:PRINT M(1):PRINT M(2):PRINT M(3):PRINT M(4):PRINT M(5):PRINT M(6):PRINT M(7):PRINT M(8):PRINT T$:PRINT MA
15084 PRINT CHR$(4);"CLOSE";F$+".INDEX"

15086 PRINT CHR$(4);"OPEN";F$+".BITMAP"
15088 PRINT CHR$(4);"WRITE";F$+".BITMAP" 
15090 FOR I=1 TO 19
15092 FOR J=1 TO 79
15093 PRINT B(I,J);
15094 NEXT J
15095 PRINT
15096 NEXT I
15097 PRINT CHR$(4);"CLOSE";F$+".BITMAP"

15098 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15099 GOTO 60

15100 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15105 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL
15106 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60



15110 REM 
15120 PRINT CHR$(4);"READ";F$ 
15130 FOR I=1 TO 19
15140 FOR J=1 TO 79
15150 INPUT B(I,J)
15160 NEXT J
15170 NEXT I
15180 PRINT CHR$(4);"CLOSE";F$
15181 REM 
15182 PRINT CHR$(4);"READ";F$+".INDEX"
15183 INPUT X1:INPUT Y1:INPUT X9:INPUT Y9:INPUT V8:INPUT V9:INPUT G1:INPUT M(1):INPUT M(2):INPUT M(3):INPUT M(4):INPUT M(5):INPUT M(6):INPUT M(7):INPUT M(8):INPUT T$:INPUT MA
15184 PRINT CHR$(4);"CLOSE";F$+".INDEX"
15185 IF M(5)=0 THEN FOR I=1 TO 8:M(I)=I:NEXT I:T$="R  DR  D  DL  L  UL  U  UR "

15186 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15187 GOSUB 15200


15188 REM 
15189 NORMAL:VTAB 20:HTAB 45:PRINT"                     "
15190 LL=1:GOSUB 1200:GOTO 60

15200 BB=0:VTAB 20:HTAB 75:PRINT"    ":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0" 
15202 FOR I=1 TO 19
15210 FOR J=1 TO 79
15220 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1:GOSUB 1200
15222 IF B(I,J)<>1 THEN VTAB I:HTAB J:PRINT" "
15230 NEXT J
15240 NEXT I
15250 RETURN


15500 NORMAL:VTAB 20:HTAB 45:PRINT"                     ":INVERSE:VTAB 23:HTAB 66:PRINT"             ":NORMAL

15502 FOR I=1 TO 19
15510 FOR J=1 TO 79
15520 VTAB I:HTAB J:PRINT" "
15530 NEXT J
15540 NEXT I

15542 FOR I=0 TO 20
15543 FOR J=0 TO 80
15544 B(I,J)=0
15545 NEXT J
15546 NEXT I


15548 BB=0
15549 VTAB 20:HTAB 75:PRINT"   0":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0"

15550 IF MK=1 THEN MK=0:RETURN

15560 GOTO 60

15800 HOME
15802 PRINT CHR$(4);"CATALOG"+",D2,S6"
15810 PRINT:PRINT"<PRESS ANY KEY TO BE CONTINUE>":NORMAL:GET CT$:PRINT CT$
15820 HOME:BB=0
15830 FOR I=1 TO 19
15840 FOR J=1 TO 79
15850 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
15860 NEXT J
15870 NEXT I

15880 IF D2=1 THEN D2=0:RETURN

15990 GOTO 52

22200 INVERSE:VTAB 23:HTAB 50:PRINT"ERROR OCCURED":NORMAL:FOR I=1 TO 50000:NEXT I:GOSUB 61000:MK=0:GOTO 60



27000 S1=S1+1:N1=21:N2=78
27010 IF S1>9 THEN N2=N2-1
27020 IF S1>99 THEN N2=N2-1
27030 IF S1>999 THEN N2=N2-1
27040 VTAB N1:HTAB N2: PRINT S1
27050 RETURN

29000 IF X1=10 AND Y1=40 THEN 29040
29010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
29020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
29030 IF X2=10 AND Y2=40 THEN 29050
29040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

29050 RETURN


30000 XI=X1:YI=Y1

30010 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"MAZE PAINTER":VTAB 23:HTAB 11:GET A$:GOSUB 55000:VTAB 23:HTAB 11:PRINT A$:NORMAL

30030 IF A$="A" THEN X2=X1:Y2=Y1:AP=1:GOSUB 31000:GOTO 56000

30032 IF A$="B" THEN X1=10:Y1=40:X2=X1:Y2=Y1:XC=10:YC=40:MK=1:ER=1:BP=1:P1=0:P2=-P1:P3=0:P4=-P3:GOSUB 62000:GOSUB 59000:GOTO 32000

30040 IF A$=CHR$(43) AND BP=1 THEN X1=XI:Y1=YI:MK=0:ER=0:BP=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOSUB 15200:GOSUB 1200:GOTO 60

30042 IF A$=CHR$(43) AND AP=1 THEN MK=0:ER=0:AP=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOSUB 15200:GOSUB 1200:GOTO 60

30044 IF A$=CHR$(43) THEN X1=XI:Y1=YI:MK=0:ER=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOSUB 15200:GOSUB 1200:GOTO 60

30060 GOTO 30010


31000 NORMAL
31010 IF B(X1,Y1)=1 THEN VTAB X1:HTAB Y1:PRINT"$"
31020 IF B(X1,Y1)=0 THEN VTAB X1:HTAB Y1:PRINT" "
31030 GOSUB 1500:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:X1=X2:Y1=Y2
31040 RETURN



32000 X1=10:Y1=40:INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"BORDER ADJUSTER":VTAB 23:HTAB 11:GET A$:GOSUB 55000:VTAB 23:HTAB 11:PRINT A$:NORMAL

32066 IF A$="I" THEN BA=1:GOSUB 59010:P1=P1-1:GOSUB 52000:P2=-P1:GOSUB 59000:BA=0
32067 IF A$="M" THEN BA=1:GOSUB 59010:P1=P1+1:GOSUB 52000:P2=-P1:GOSUB 59000:BA=0
32068 IF A$="K" THEN BA=1:GOSUB 59010:P3=P3-1:GOSUB 52000:P4=-P3:GOSUB 59000:BA=0
32069 IF A$="J" THEN BA=1:GOSUB 59010:P3=P3+1:GOSUB 52000:P4=-P3:GOSUB 59000:BA=0

32070 IF A$=CHR$(43) THEN GOSUB 61000:INVERSE:VTAB 10:HTAB 42:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 30010

32071 IF A$="D" THEN 58000




32080 GOTO 32000




32090 GOTO 58000



47000 REM 
47010 IF D(XC,YC)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
47020 IF D(XC,YC)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
47030 REM 
47040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL

47050 RETURN



48000 IF X1=10 AND Y1=40 THEN 48040
48010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
48020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
48030 IF X2=10 AND Y2=40 THEN 48050
48040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

48050 RETURN





49000 FOR I=1 TO 19
49010 FOR J=1 TO 79
49020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 49040
49030 VTAB I:HTAB J:PRINT" "
49040 NEXT J
49050 NEXT I
49060 RETURN


49500 BB=0

49502 FOR I=1 TO 19
49510 FOR J=1 TO 79
49520 IF B(I,J)=1 THEN BB=BB+1
49530 NEXT J
49540 NEXT I

49542 GOSUB 1200

49550 RETURN

50000 GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
50010 RETURN

50100 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 1200:X1=X2:Y1=Y2
50110 RETURN

50200 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 1200:X1=X2:Y1=Y2
50210 RETURN



52000 IF P1<-5 THEN P1=-5
52010 IF P1>3 THEN P1=3
52020 IF P3<-35 THEN P3=-35
52030 IF P3>3 THEN P3=3

52060 RETURN




55000 IF A$=CHR$(10) OR A$=CHR$(13) OR A$=CHR$(22) OR A$=CHR$(12) OR A$=CHR$(11) OR A$=CHR$(17) OR A$=CHR$(23) OR A$=CHR$(21) OR A$=CHR$(27) THEN A$=" "
55002 RETURN
 


56000 AW=1:GOSUB 59800

56001 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL


56002 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"ALPHABET":VTAB 23:HTAB 11:GET A$:GOSUB 55000:VTAB 23:HTAB 11:PRINT A$:NORMAL

56066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1500:GOSUB 48000:NORMAL:VTAB 10:HTAB 40:PRINT"M":X1=X2:Y1=Y2
56067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1500:GOSUB 48000:NORMAL:VTAB 10:HTAB 40:PRINT"M":X1=X2:Y1=Y2
56068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1500:GOSUB 48000:NORMAL:VTAB 10:HTAB 40:PRINT"M":X1=X2:Y1=Y2
56069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1500:GOSUB 48000:NORMAL:VTAB 10:HTAB 40:PRINT"M":X1=X2:Y1=Y2

56070 IF A$=CHR$(43) THEN INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 30010

56080 IF A$="B" THEN 57000
56082 IF A$="C" THEN 57500

56084 IF A$="L" THEN AW=1:GOSUB 59800


56090 GOTO 56001


57000 REM 

57100 FOR I=7+P1 TO 13+P2
57144 FOR J=37+P3 TO 43+P4

57146 IF D(I,J)=1 THEN 57600
57147 IF D(I,J)=1 THEN NORMAL:VTAB I+X2-10:HTAB J+Y2-40:PRINT"$":B(I+X2-10,J+Y2-40)=1

57148 NEXT J
57149 NEXT I

57150 GOSUB 49500

57160 GOTO 56001


57500 FOR I=7+P1 TO 13+P2
57544 FOR J=37+P3 TO 43+P4

57546 IF D(I,J)=1 THEN 57700
57547 IF D(I,J)=1 THEN NORMAL:VTAB I+X2-10:HTAB J+Y2-40:PRINT" ":B(I+X2-10,J+Y2-40)=0

57548 NEXT J
57549 NEXT I

57550 GOSUB 49500

57560 GOTO 56001
 


57600 IF X2<11-I OR X2>29-I OR Y2<41-J OR Y2>119-J THEN 57148  
57610 GOTO 57147



57700 IF X2<11-I OR X2>29-I OR Y2<41-J OR Y2>119-J THEN 57548  
57710 GOTO 57547




58000 INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL

58002 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND : ":VTAB 23:HTAB 50:PRINT"PATTERN DESIGNER":VTAB 23:HTAB 11:GET A$:GOSUB 55000:VTAB 23:HTAB 11:PRINT A$:NORMAL 

58066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:XD=XC-1:YD=YC:GOSUB 1600:GOSUB 1700:GOSUB 47000:X1=X2:Y1=Y2:XC=XD:YC=YD
58067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:XD=XC:YD=YC-1:GOSUB 1600:GOSUB 1700:GOSUB 47000:X1=X2:Y1=Y2:XC=XD:YC=YD
58068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:XD=XC:YD=YC+1:GOSUB 1600:GOSUB 1700:GOSUB 47000:X1=X2:Y1=Y2:XC=XD:YC=YD
58069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:XD=XC+1:YD=YC:GOSUB 1600:GOSUB 1700:GOSUB 47000:X1=X2:Y1=Y2:XC=XD:YC=YD


58070 IF A$=CHR$(43) THEN GOSUB 62000:GOSUB 59000:NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOTO 32000


58080 IF A$="B" THEN 59100
58082 IF A$="C" THEN 59200

58084 IF A$="S" THEN 59500
58086 IF A$="L" THEN 59800

58088 IF A$="D" THEN GOSUB 60000

58089 IF A$="F" THEN P1=0:P2=0:P3=0:P4=0:FX=1:GOSUB 59500


58090 GOTO 58000



59000 INVERSE

59010 FOR I=6+P1 TO 14+P2:VTAB I:HTAB 36+P3:PRINT" ":NEXT I
59020 FOR I=6+P1 TO 14+P2:VTAB I:HTAB 44+P4:PRINT" ":NEXT I

59030 FOR J=36+P3 TO 44+P4:VTAB 6+P1:HTAB J:PRINT" ":NEXT J
59032 FOR J=36+P3 TO 44+P4:VTAB 14+P2:HTAB J:PRINT" ":NEXT J

59040 IF SO=1 THEN SO=0:RETURN
59041 IF BA=1 THEN RETURN

59042 FOR I=1 TO 19
59044 FOR J=1 TO 79
59046 D(I,J)=0
59047 NEXT J
59048 NEXT I

59050 RETURN


59100 D(XC,YC)=1
59110 GOTO 58002


59200 D(XC,YC)=0
59210 GOTO 58002


59500 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL

59502 IF FX=1 THEN INVERSE:VTAB 23:HTAB 50:PRINT"FIXING      ":NORMAL:GOTO 59507

59505 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
59507 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 58002

59509 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 59500

59510 IF FX=1 THEN 59582

59512 PRINT CHR$(4);"OPEN";F$+".PATTERN"
59520 PRINT CHR$(4);"WRITE";F$+".PATTERN" 
59530 FOR I=7+P1 TO 13+P2
59540 FOR J=37+P3 TO 43+P4
59550 PRINT D(I,J)
59560 NEXT J
59570 NEXT I
59572 PRINT CHR$(4);"CLOSE";F$+".PATTERN"


59582 PRINT CHR$(4);"OPEN";F$+".PATTERN"+".INDEX"
59584 PRINT CHR$(4);"WRITE";F$+".PATTERN"+".INDEX" 
59586 PRINT P1:PRINT P2:PRINT P3:PRINT P4
59588 PRINT CHR$(4);"CLOSE";F$+".PATTERN"+".INDEX"

59596 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL

59598 IF FX=1 THEN FX=0:RETURN

59599 GOTO 58002


59800 INVERSE:VTAB 23:HTAB 12:PRINT"                                      ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
59805 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL

59806 IF AW=1 AND F$=CHR$(43) THEN AW=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:RETURN

59807 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 58002


59814 PRINT CHR$(4);"READ";F$+".PATTERN"+".INDEX" 
59816 INPUT P1:INPUT P2:INPUT P3:INPUT P4
59818 PRINT CHR$(4);"CLOSE";F$+".PATTERN"+".INDEX"


59850 REM 
59852 PRINT CHR$(4);"READ";F$+".PATTERN" 
59854 FOR I=7+P1 TO 13+P2
59856 FOR J=37+P3 TO 43+P4
59858 INPUT D(I,J)
59860 NEXT J
59870 NEXT I
59880 PRINT CHR$(4);"CLOSE";F$+".PATTERN"

59881 IF AW=1 THEN AW=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:RETURN

59882 GOSUB 59900

59883 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL

59886 GOTO 58000


59900 GOSUB 62000:SO=1:GOSUB 59000
59902 FOR I=7+P1 TO 13+P2
59910 FOR J=37+P3 TO 43+P4
59920 IF D(I,J)=1 THEN NORMAL:VTAB I:HTAB J:PRINT"$"
59922 REM IF D(I-6,J-38)<>1 THEN VTAB I:HTAB J:PRINT" "
59930 NEXT J
59940 NEXT I
59950 RETURN


60000 FOR I=1 TO 19
60044 FOR J=1 TO 79
60046 NORMAL:VTAB I:HTAB J:PRINT" "
60047 NEXT J
60048 NEXT I

60049 GOSUB 59000

60050 RETURN
 


61000 BB=0
61030 FOR I=1 TO 19
61040 FOR J=1 TO 79
61050 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1:GOSUB 1200:GOTO 61060
61052 VTAB I:HTAB J:PRINT" "
61060 NEXT J
61070 NEXT I

61080 GOSUB 59042

61090 RETURN


62000 REM

62102 FOR I=1 TO 19
62110 FOR J=1 TO 79
62120 VTAB I:HTAB J:PRINT" "
62130 NEXT J
62140 NEXT I

62150 RETURN




